bitkeeper revision 1.1159.258.156 (429ba4d3T2WmSlhY2aTmV6KN88hZHw)
authorsmh22@tempest.cl.cam.ac.uk <smh22@tempest.cl.cam.ac.uk>
Mon, 30 May 2005 23:42:11 +0000 (23:42 +0000)
committersmh22@tempest.cl.cam.ac.uk <smh22@tempest.cl.cam.ac.uk>
Mon, 30 May 2005 23:42:11 +0000 (23:42 +0000)
Solve badness problem when udp_poll() receives fragmented skbuff w/ CONFIG_HIGHMEM
Upstream patch (now in -net tree) from Herbert Xu.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Steven Hand <steven@xensource.com>
.rootkeys
patches/linux-2.6.11/udp-frag.patch [new file with mode: 0644]

index 2b88eb62d05666579490a256de5517be7e32ea52..b232c26d4a316740306153058a284dbd0a07ed60 100644 (file)
--- a/.rootkeys
+++ b/.rootkeys
 428359d4b3fDYtazwXi4UUmSWaOUew patches/linux-2.6.11/linux-2.6.11.11.patch
 418abc69J3F638vPO9MYoDGeYilxoQ patches/linux-2.6.11/nettel.patch
 429ae875I9ZrqrRDjGD34IC2kzDREw patches/linux-2.6.11/rcu-nohz.patch
+429ba3007184K-y6WHQ6KgY65-lEIQ patches/linux-2.6.11/udp-frag.patch
 3f776bd1Hy9rn69ntXBhPReUFw9IEA tools/Makefile
 40e1b09db5mN69Ijj0X_Eol-S7dXiw tools/Rules.mk
 4124b307nRyK3dhn1hAsvrY76NuV3g tools/check/Makefile
diff --git a/patches/linux-2.6.11/udp-frag.patch b/patches/linux-2.6.11/udp-frag.patch
new file mode 100644 (file)
index 0000000..9e8a26e
--- /dev/null
@@ -0,0 +1,55 @@
+diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
+--- a/net/ipv4/udp.c
++++ b/net/ipv4/udp.c
+@@ -738,7 +738,7 @@ int udp_ioctl(struct sock *sk, int cmd, 
+                       unsigned long amount;
+                       amount = 0;
+-                      spin_lock_irq(&sk->sk_receive_queue.lock);
++                      spin_lock_bh(&sk->sk_receive_queue.lock);
+                       skb = skb_peek(&sk->sk_receive_queue);
+                       if (skb != NULL) {
+                               /*
+@@ -748,7 +748,7 @@ int udp_ioctl(struct sock *sk, int cmd, 
+                                */
+                               amount = skb->len - sizeof(struct udphdr);
+                       }
+-                      spin_unlock_irq(&sk->sk_receive_queue.lock);
++                      spin_unlock_bh(&sk->sk_receive_queue.lock);
+                       return put_user(amount, (int __user *)arg);
+               }
+@@ -848,12 +848,12 @@ csum_copy_err:
+       /* Clear queue. */
+       if (flags&MSG_PEEK) {
+               int clear = 0;
+-              spin_lock_irq(&sk->sk_receive_queue.lock);
++              spin_lock_bh(&sk->sk_receive_queue.lock);
+               if (skb == skb_peek(&sk->sk_receive_queue)) {
+                       __skb_unlink(skb, &sk->sk_receive_queue);
+                       clear = 1;
+               }
+-              spin_unlock_irq(&sk->sk_receive_queue.lock);
++              spin_unlock_bh(&sk->sk_receive_queue.lock);
+               if (clear)
+                       kfree_skb(skb);
+       }
+@@ -1334,7 +1334,7 @@ unsigned int udp_poll(struct file *file,
+               struct sk_buff_head *rcvq = &sk->sk_receive_queue;
+               struct sk_buff *skb;
+-              spin_lock_irq(&rcvq->lock);
++              spin_lock_bh(&rcvq->lock);
+               while ((skb = skb_peek(rcvq)) != NULL) {
+                       if (udp_checksum_complete(skb)) {
+                               UDP_INC_STATS_BH(UDP_MIB_INERRORS);
+@@ -1345,7 +1345,7 @@ unsigned int udp_poll(struct file *file,
+                               break;
+                       }
+               }
+-              spin_unlock_irq(&rcvq->lock);
++              spin_unlock_bh(&rcvq->lock);
+               /* nothing to see, move along */
+               if (skb == NULL)
+